/*
 * Copyright [2009] [Marcin Rzeźnicki]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
 */
package mr.go.yaxc.actions;

import mr.go.yaxc.Action;
import mr.go.yaxc.ScopeHandler;

import org.xml.sax.Attributes;

/**
 * This action creates a float, which it passes to parent's <i>params</i>
 * 
 * <h6>on xml element start:</h6> nothing <h6>on xml element end:</h6> Creates
 * float from body, interpreting string as {@link Float#valueOf(String)} does
 * <h6>
 * prerequisites:</h6> <i>params</i> present, otherwise warning is emitted <h6>
 * attributes:</h6> none
 *<p>
 * Example:<br>
 * 
 * <pre>
 * 		&lt;Call name=&quot;someMethod&quot;&gt;
 * 			&lt;Float&gt;1.25&lt;/Float&gt;
 * 		&lt;/Call&gt;
 * </pre>
 * 
 * @author Marcin Rzeźnicki
 * 
 */
public class CreateFloat extends Action {

    @Override
    public void carryOut(String name, Attributes attributes,
                         ScopeHandler handler)
            throws Exception {
    }

    @Override
    public void processed(String body, ScopeHandler handler)
            throws Exception {
        handler.addParam(Float.valueOf(body));
    }
}
